<template>
	<div style="padding-bottom: 5px">
    <el-row style="text-align: right;">
      <el-button-group>
        <el-button size="mini" type="primary" @click="create()" icon="el-icon-plus">新  建</el-button>
      </el-button-group>
      <el-dropdown trigger="click">
        <el-button size="mini" icon="el-icon-s-grid">
          <i class="el-icon-arrow-down el-icon--right"></i>
        </el-button>
        <el-dropdown-menu slot="dropdown">
          <el-dropdown-item>
            <el-link :underline="false" @click="create" v-if="value.btnOperation.showcreate" >
              <i class="el-icon-plus el-icon--right"></i>&nbsp;新  增
            </el-link>             
          </el-dropdown-item>
          <el-dropdown-item v-if="items.length > 0 " v-for = "item in items" >
            <el-link :underline="false" @click="itemclient(item.clientevent)">
              <i class="el-icon--right" :class="item.icon"></i>&nbsp;{{item.name}}
            </el-link>            
          </el-dropdown-item>
          <el-dropdown-item>
            <el-link :underline="false" @click="batchDelete" v-if="value.btnOperation.showBatchDelete" >
              <i class="el-icon-delete el-icon--right"></i>&nbsp;删  除
            </el-link>             
          </el-dropdown-item>
        </el-dropdown-menu>
      </el-dropdown>
    </el-row>
	</div>
</template>
<script>
	export default {
    props: {
      value: {
        type: Object,
        default: {}
      },
      items: {
        type: Array,
        default: []
      },
      
    },
		data() {
			return {
        visible: false
			}
		},
    methods: {
      itemclient(eventname) {
        eventname()
      },
      create() {
        this.$emit("create")
      },
      batchDelete() {

      }
    }
	}
</script>
<style>
.el-dropdown-link {
    cursor: pointer;
    color: #409eff;
}
</style>